###############################################################################
###
### OpenStopMotion Makefile
###
###############################################################################
#
# This file is part of OpenStopMotion by Patrick Fedick
#
# $Author: pafe1234@gmail.com $
# $Revision: 483 $
# $Date: 2014-02-20 20:04:03 +0100 (Do, 20 Feb 2014) $
# $Id: build_package.sh 483 2014-02-20 19:04:03Z pafe1234@gmail.com $
#
#
# Copyright (c) 2013 Patrick Fedick <patrick@pfp.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
### Global Options
###############################################################################

PREFIX		?= @prefix@
CC		= @CC@
CXX		= @CXX@
CFLAGS		= @CFLAGS@
CPPFLAGS	= @CPPFLAGS@
LDFLAGS		= @LDFLAGS@
QMAKE		= @QMAKE@
LIBS		= @LIBS@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @ZLIB_LIBS@ @BZ2_LIBS@ @PCRE_LIBS@ @FT2_LIBS@ @ICONV_LIBS@


###########################################################################
### Targets
###########################################################################

release: tmp/lib/libppl7.a osm/release/OpenStopMotion

install: osm/release/OpenStopMotion
	mkdir -p $(PREFIX)/bin $(PREFIX)/share/pixmaps $(PREFIX)/share/applications
	cp osm/release/OpenStopMotion $(PREFIX)/bin
	cp osm/resources/icon256x256.png $(PREFIX)/share/pixmaps/OpenStopMotion.png
	cp OpenStopMotion.desktop $(PREFIX)/share/applications

deinstall:
	rm -rf $(PREFIX)/bin/OpenStopMotion
	rm -rf $(PREFIX)/share/pixmaps/OpenStopMotion.png
	rm -rf $(PREFIX)/share/applications/OpenStopMotion.desktop
	
clean:
	cd ppl7; make clean
	rm -rf tmp
	rm -rf osm/release osm/debug

osm/release/OpenStopMotion: tmp/lib/libppl7.a
	cd osm; $(QMAKE) INCLUDEPATH+=../tmp/include OpenStopMotion.pro; make -f Makefile.Release

tmp/lib/libppl7.a: ppl7/Makefile
	cd ppl7; make install TARGETLIB=../tmp/lib TARGETINCLUDE=../tmp/include TARGETBIN=../tmp/bin



